<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%--
  Created by IntelliJ IDEA.
  User: bobo
  Date: 16-10-27
  Time: 下午5:57
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <jsp:include page="../layout/head.jsp" >
        <jsp:param name="title" value="更新标签" />
    </jsp:include>
    <style>
        .field {
            padding: 9px;
        }
    </style>

</head>
<body>
<%--<div>--%>
    <%--<h1>更新标签</h1>--%>
    <%--<form action="${pageContext.request.contextPath}/admin/tag/upd" method="post">--%>
        <%--<input type="hidden" name="tid" value="${tag.id}">--%>
        <%--名称：<input type="text" name="name" value="${tag.name}"><br>--%>
        <%--类别：--%>
        <%--<select name="cid">--%>
            <%--<c:forEach items="${categories}" var="category">--%>
                <%--<option value="${category.id}" ${category.id == tag.category.id ? "selected":""}>${category.name}</option>--%>
            <%--</c:forEach>--%>
        <%--</select><br>--%>
        <%--状态：--%>
        <%--禁用<input type="radio"  name="status" value="0" ${tag.status ==0 ?"checked":""} >--%>
        <%--启用<input type="radio"  name="status" value="1" ${tag.status ==1 ?"checked":""} ><br>--%>
        <%--<input type="submit" value="提交">--%>
    <%--</form>--%>
<%--</div>--%>
<div class="panel admin-panel">
    <div class="panel-head" id="add"><strong><span class="icon-pencil-square-o"></span>更新标签</strong></div>
    <div class="body-content">
        <form action="${pageContext.request.contextPath}/admin/tag/upd" method="post" class="form-x">
            <input type="hidden" name="tid" value="${tag.id}">
            <div class="form-group">
                <div class="label">
                    <label>选择类别：</label>
                </div>
                <div class="field">
                    <select name="cid" class="input w50">
                        <c:forEach items="${categories}" var="category">
                            <option value="${category.id}" ${category.id == tag.category.id ? "selected":""}>${category.name}</option>
                        </c:forEach>
                    </select>
                    <div class="tips"></div>
                </div>
            </div>

            <div class="form-group">
                <div class="label">
                    <label>名称：</label>
                </div>
                <div class="field">
                    <input type="text" class="input w50" name="name" value="${tag.name}" data-validate="required:请输入名称" />
                    <div class="tips"></div>
                </div>
            </div>
            <div class="form-group">
                <div class="label">
                    <label>状态：</label>
                </div>
                <div class="field">
                    禁用<input type="radio"  name="status" value="0" ${tag.status ==0 ?"checked":""} />
                    启用<input type="radio"  name="status" value="1" ${tag.status ==1 ?"checked":""} />
                    <div class="tips"></div>
                </div>
            </div>
            <div class="form-group">
                <div class="label">
                    <label></label>
                </div>
                <div class="field">
                    <button class="button bg-main icon-check-square-o" type="submit"> 提交</button>
                </div>
            </div>
        </form>
    </div>
</div>
</body>
</html>
